<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>

<script>
    // join() 方法以指定参数作为分割符，将所有数组成员连接为一个字符串返回，如果不提供参数，默认用逗号分隔

    var arr = [1,2,3,4,5]
    console.log(arr.join(""))
    console.log(arr.join(" "))
    console.log(arr.join())

    // 如果数组成员是undefined或null或空位，会被转成空字符串
    var arr1 = [1,2,3,4,5,undefined,null]
    console.log(arr1.join())
</script>